#ifndef __MOTION_H
#define __MOTION_H

#include "stepping_motor_driver.h"
#include "servo_driver.h"

#define return_to_front         4

//�߶ȱ�ʶ
#define ground                  0
#define plate                   1
#define second_floor            2
#define turn_table              3

#define ground_high         12000       //����߶�
#define plate_high          4500        //���Ӹ߶�
#define second_floor_high   6700        //�����ϸ߶�
#define turn_table_high     4000        //ת�̸߶�

#define plate_2_turn_right  0
#define plate_2_turn_left   1
#define plate_2_NULL_turn   2

//Բ�Ķ�λ����  
#define center_x_location       320 //+ 20
#define center_y_location       240 //- 10
#define circle_dead_area        5
#define circle_second_area      50
#define line_degree_dead_area   5
#define line_correct_data       0

//��������
void motion_Init(void);
void gimbal_motor_up(char choose_place);
void gimbal_motor_down(char choose_place);
void gimbal_motor_turn(char choose_disc, char plate_2_way);

//��϶���
void get_goods_on_ground(void);
void put_goods_on_plate(char choose_disc);
void get_goods_on_plate(char choose_disc);
void put_goods_on_ground(void);
void put_goods_on_second_floor(void);
void get_goods_on_turn_table(void);

//�˶��������
void suspend_motion_task(void);
void resume_motion_task(void);

//��ȡ���Ʒ/��Ʒ���ķ���;���
int* get_way(char location);

//��λ
int* circle_location(void);
int* line_location(void);
void circle_location_task(char p_color);
void line_location_task(void);

#endif
